using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using ClickSocial.Entities;
using ClickSocial.Framework;

namespace ClickSocial.Data
{
    public class BaseDal
    {
        protected string table;

        public DataSet ListarDataSet()
        {
            DataSet ds = null;
            try
            {
                ds = DB.ClickSocial.ExecuteDataSet( "cs" + table + "_sp" + table);
            }
            catch (Exception ex)
            {
                throw ExceptionManager.Handle(ex, "Error al listar  " + table);
            }
            return ds;
        }

        public IDataReader ListarReader()
        {
            IDataReader dr = null;
            try
            {
                dr = (IDataReader)DB.ClickSocial.ExecuteReader("cs" + table + "_sp" + table);
            }
            catch (Exception ex)
            {
                throw ExceptionManager.Handle(ex, "Error al listar  " + table);
            }
            return dr;
        }

    }
}
